<?php

namespace Ue\ErpBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * StockHistory
 *
 * @ORM\Table(name="ue_stock_history", indexes={@ORM\Index(name="ue_stock_history_warehouse_id_idx", columns={"warehouse_id"}), @ORM\Index(name="ue_stock_history_product_id_idx", columns={"product_id"})})
 * @ORM\Entity
 */
class StockHistory
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="type", type="string", length=20, nullable=true)
     */
    private $type = 'order';

    /**
     * @var integer
     *
     * @ORM\Column(name="qty", type="integer", nullable=true)
     */
    private $qty;

    /**
     * @var integer
     *
     * @ORM\Column(name="old_stock", type="integer", nullable=true)
     */
    private $oldStock;

    /**
     * @var integer
     *
     * @ORM\Column(name="new_stock", type="integer", nullable=true)
     */
    private $newStock;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created_at", type="datetime", nullable=false)
     */
    private $createdAt;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="updated_at", type="datetime", nullable=false)
     */
    private $updatedAt;

    /**
     * @var \Product
     *
     * @ORM\ManyToOne(targetEntity="Product")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="product_id", referencedColumnName="id")
     * })
     */
    private $product;

    /**
     * @var \Warehouse
     *
     * @ORM\ManyToOne(targetEntity="Warehouse")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="warehouse_id", referencedColumnName="id")
     * })
     */
    private $warehouse;



    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set type
     *
     * @param string $type
     * @return StockHistory
     */
    public function setType($type)
    {
        $this->type = $type;

        return $this;
    }

    /**
     * Get type
     *
     * @return string 
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set qty
     *
     * @param integer $qty
     * @return StockHistory
     */
    public function setQty($qty)
    {
        $this->qty = $qty;

        return $this;
    }

    /**
     * Get qty
     *
     * @return integer 
     */
    public function getQty()
    {
        return $this->qty;
    }

    /**
     * Set oldStock
     *
     * @param integer $oldStock
     * @return StockHistory
     */
    public function setOldStock($oldStock)
    {
        $this->oldStock = $oldStock;

        return $this;
    }

    /**
     * Get oldStock
     *
     * @return integer 
     */
    public function getOldStock()
    {
        return $this->oldStock;
    }

    /**
     * Set newStock
     *
     * @param integer $newStock
     * @return StockHistory
     */
    public function setNewStock($newStock)
    {
        $this->newStock = $newStock;

        return $this;
    }

    /**
     * Get newStock
     *
     * @return integer 
     */
    public function getNewStock()
    {
        return $this->newStock;
    }

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     * @return StockHistory
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * Get createdAt
     *
     * @return \DateTime 
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set updatedAt
     *
     * @param \DateTime $updatedAt
     * @return StockHistory
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

    /**
     * Get updatedAt
     *
     * @return \DateTime 
     */
    public function getUpdatedAt()
    {
        return $this->updatedAt;
    }

    /**
     * Set product
     *
     * @param \Ue\ErpBundle\Entity\Product $product
     * @return StockHistory
     */
    public function setProduct(\Ue\ErpBundle\Entity\Product $product = null)
    {
        $this->product = $product;

        return $this;
    }

    /**
     * Get product
     *
     * @return \Ue\ErpBundle\Entity\Product 
     */
    public function getProduct()
    {
        return $this->product;
    }

    /**
     * Set warehouse
     *
     * @param \Ue\ErpBundle\Entity\Warehouse $warehouse
     * @return StockHistory
     */
    public function setWarehouse(\Ue\ErpBundle\Entity\Warehouse $warehouse = null)
    {
        $this->warehouse = $warehouse;

        return $this;
    }

    /**
     * Get warehouse
     *
     * @return \Ue\ErpBundle\Entity\Warehouse 
     */
    public function getWarehouse()
    {
        return $this->warehouse;
    }
}
